import { NetService } from '@core/http'
import { Injectable } from '@angular/core'
import { of } from 'rxjs'
// import ProductList from '../../assets/json/productlist.json'
// import Configure from '../../assets/json/customerasset.json'

import { assetController } from '../config/service/asset.controller'

@Injectable()
export class ApiService {
  constructor(private net: NetService) {}

  /**
   * 获取推荐产品
   */
  public getrecommondProduct() {
    return this.net.send({
      service: assetController.getrecommondProduct,
      params: {
        index: 0,
        size: 2,
        condition: {
          riskLevelCode: 'R1',
          productPeriodicity: 90,
          yearsProfit: 0.08,
          productType: 'pt_001'
        }
      }
    })
  }
  /**
   * 删除推荐产品
   */
  public delrecommondProduct(productid){
    return this.net.send({
      service: assetController.delrecommondProduct,
      append:[productid]
    })
  }
  // public getAssetConfigure() {
  //   return of(Configure)
  // }

  /***
   * 配置列表
   */
  public getAssetList(queryPaeams){
    return this.net.send({
      service: assetController.getAssetList,
      params:queryPaeams
    })
  }

  /**
   * 查询资产配置
   */
  public queryAsset(assetsId){
    return this.net.send({
      service: assetController.queryAsset,
      append:[assetsId]
    })
  }
}
